﻿using System.Web.Mvc;
using SilenthinkCommon.Extension;

namespace Web.Areas.Cart
{
    public class CartAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Cart";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.Routes.MapSubDomainRoute(
                "Add", AreaName.ToLower(), // SubDomain
                "Add/{param}", // Url
                new { controller = "Cart", action = "Add", param = UrlParameter.Optional }, // Defaults
                new[] { "Web.Areas.Cart.Controllers" }); // Namespace

            context.Routes.MapSubDomainRoute(
               "Mini", AreaName.ToLower(), // SubDomain
               "Mini/{callback}", // Url
               new { controller = "Cart", action = "Mini", callback = UrlParameter.Optional }, // Defaults
               new[] { "Web.Areas.Cart.Controllers" }); // Namespace

            context.Routes.MapSubDomainRoute(
                "CartDdefault", AreaName.ToLower(), // SubDomain
                "{controller}/{action}/{param}", // Url
                new { controller = "Home", action = "Index", param = UrlParameter.Optional }, // Defaults
                new[] { "Web.Areas.Cart.Controllers" }); // Namespace
        }
    }
}
